﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
namespace GPCSC.Web.AJAX
{
    /// <summary>
    /// selhd 的摘要说明
    /// </summary>
    public class selhd : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/xml";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        #region IHttpHandler 成员

        bool IHttpHandler.IsReusable
        {
            get { throw new NotImplementedException(); }
        }

        void IHttpHandler.ProcessRequest(HttpContext context)
        {

            DataSet ds = new DataSet();
            Hashtable htable = new Hashtable();
            string nf = context.Request["hdnf"].ToString();
            htable.Add("@ssyear", nf);
            DataReturn drs = new DataReturn();
            ds = drs.ReturnData(htable, "sel_hdls_bynf");


            string str = "<hdlist>";
            if (ds.Tables[0].Rows.Count > 0)
            {

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    str += "<hd>";
                    str += "<hdsid>" + dr["hdsid"].ToString() + "</hdsid>";
                    str += "<hdtitile>" + dr["hdtitile"].ToString() + "</hdtitile>";
                    str += "<bgyear>" + dr["bgyear"].ToString() + "</bgyear>";
                    str += "<edyear>" + dr["edyear"].ToString() + "</edyear>";
                    str += "<sdts>" + dr["sdts"].ToString() + "</sdts>";
                    str += "<ssyear>" + dr["ssyear"].ToString() + "</ssyear>";
                    str += "</hd>";
                }
            }
            str += "</hdlist>";
            context.Response.ContentType = "text/xml";
            context.Response.Write(str);

        }

        #endregion
    }
}